import type { ProColumns } from '@ant-design/pro-table';
export type columnsDataType = {
    id: number,
    order: number,
    discountCode: number
    discountName: string
    discountCreationDate: string
    effectiveDate: string
    expirationDate: string
    state: string
    offsetCondition: string
    totalProportion: string
    memberEnjoyProportion: string
    platformEnjoyProportion: string
};
const columnsData: ProColumns<columnsDataType>[] = [
    
    // 配置搜索框
    {
        title: '折扣编码',
        dataIndex: 'discountCode',
        hideInTable:true,
    },
    {
        title: '状态',
        dataIndex: 'state',
        valueType: 'select',
        hideInTable:true,
        valueEnum: {
            all: { text: '全部', status: 'Default' },
            open: {
                text: '失效',
                status: 'Error',
            },
            closed: {
                text: '生效',
                status: 'Success',
            },
            processing: {
                text: '未生效',
                status: 'Processing',
            },
        },
    },
    {
        title: '注册日期',
        dataIndex: 'configurationDate',
        colSize: 1,
        hideInTable:true,
        search: {
            transform: (value) => {
                return {
                    startTime: value[0],
                    endTime: value[1],
                };
            },
        },
    },
   
    // table里面的内容
    {
        title: '折扣编码',
        dataIndex: 'discountCode',
        hideInSearch:true,
    },
    {
        title: '折扣名称',
        dataIndex: 'discountName',
        hideInSearch:true,
    },
    {
        title: '折扣创建日期',
        dataIndex: 'discountCreationDate',
        hideInSearch:true,
    },
    {
        title: '生效时间',
        dataIndex: 'effectiveDate',
        colSize: 1.5,
        hideInSearch:true,
    },
    {
        title: '失效时间',
        dataIndex: 'expirationDate',
        hideInSearch: true,
    },
    {
        title: '折扣状态',
        dataIndex: 'state',
        valueType: 'select',
        hideInSearch:true,
    },
    {
        title: '折扣抵消条件(PDB)',
        dataIndex: 'offsetCondition',
        hideInSearch:true,
    },
    {
        title: '折扣总比例',
        dataIndex: 'totalProportion',
        hideInSearch:true,
    },
    {
        title: '会员享有比例',
        dataIndex: 'memberEnjoyProportion',
        hideInSearch:true,
    },
    {
        title: '平台享有比例',
        dataIndex: 'platformEnjoyProportion',
        hideInSearch:true,
    },
    {
        title: '操作',
        hideInSearch: true,
        dataIndex: 'action',
    },
];

export default columnsData;